package cn.momoshenchi.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.momoshenchi.pojo.StudentGpa;
import cn.momoshenchi.service.StudentGpaService;
import cn.momoshenchi.dao.StudentGpaMapper;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 *
 */
@Service
public class StudentGpaServiceImpl extends ServiceImpl<StudentGpaMapper, StudentGpa>
implements StudentGpaService{


    @Override
    @CacheEvict(value="student:gpa", key="'student:Gpa'")
    public void removeGpaById(Integer id)
    {
        removeById(id);
    }

    @Override
    @Cacheable(value="student:gpa", key="'student:Gpa'")
    public StudentGpa getGpaById(Integer id)
    {
        return getById(id);
    }

    @Override
    @Cacheable(value="student:gpa", key="'student:GpaList'")
    public IPage<StudentGpa> getList(IPage<StudentGpa> page1)
    {
        return  page(page1);
    }

    @Override
    @CachePut(value="student:gpa", key="'student:Gpa'")
    public void updateGpaById(StudentGpa studentGpa)
    {
        updateById(studentGpa);
    }

    @Override
    @CachePut(value="student:gpa", key="'student:Gpa'")
    public void insertGpa(StudentGpa studentGpa)
    {
        save(studentGpa);
    }


}




